#include<iostream>
#include<cstdio>
#include<cstdlib>
#include<random>
using namespace std;
mt19937 RAND(random_device{}());
const int inf=(int)(1e5);
int n,m,q,maxn;
int main()
{
	freopen("journey.in","w",stdout);
	if (RAND()&1) maxn=inf;
	else maxn=10;
	n=RAND()%10+1,m=RAND()%10+1,q=RAND()%10+1;
	cout<<n<<' '<<m<<' '<<q<<endl;
	for (int i=1;i<=m;++i) cout<<RAND()%n+1<<' '<<RAND()%n+1<<' '<<RAND()%maxn<<endl;
	while (q--) cout<<RAND()%maxn<<endl;
	return 0;
}
